package com.dddpeter.app.controller;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.dddpeter.app.common.Services;
import com.dddpeter.app.common.SpringBeanFactoryUtils;
import com.dddpeter.app.entity.User;
import com.dddpeter.app.object.BussinessService;

/** 
* @ClassName: PersonalInfoController 
* @Description: 个人信息页面控制类
* @author Peter Lee 
* @date 2014年8月12日 下午4:03:17 
*  
*/
@Controller
public class PersonalInfoController {
	SpringBeanFactoryUtils spring = SpringBeanFactoryUtils.getInstance();
	@Resource(name = "userInfoGetService")
	BussinessService userInfoGetService;
	Map<String,Object> model = new HashMap<String,Object>();
	Map<Object,Object> paramMap = new HashMap<Object,Object>();
	Map<Object,Object> resMap = new HashMap<Object,Object>();

	/** 
	* @Title: getUserInfo 
	* @Description: 用户信息页面展示控制方法
	* @param session
	* @return    设定文件 
	* @return ModelAndView    返回类型 
	* @throws 
	*/
	@RequestMapping("/personalinfo.do")
	public ModelAndView getUserInfo(HttpSession session) {
		User user = (User) session.getAttribute("user");
		paramMap.put("user", user);
		userInfoGetService.service(Services.getGetUserinfoService(), paramMap);
		resMap = userInfoGetService.output();
		model.put("usermap", resMap);
		return new ModelAndView("personalinfo", model);
	}

}
